<?php

/*
 * 
 */
// Report table:

foreach ($big as $team => $name) {
    echo '<li><b>' . $team . '</b></li>';
    foreach ($big[$team] as $name => $sr) {
        echo '<a href="#' . $name . '">' . $name . '</a><br>';
    }
}

foreach ($big as $team => $name) {
    echo '<li><b>' . $team . '</b>';
    foreach ($big[$team] as $name => $sr) {
        echo '<table><tr><td><a name="' . $name . '">TSE</a></td><td>SR #</td><td>status</td><td title"Tier-3 hands off activated">Tier3</td>
            <td title="KCS document linked">KCS</td><td title="Documentation linked">Docs</td>
            <td title="Release Notes linked">RN</td><td title="Marked as NotUsed">NotUsed</td>
            <td title="Linked by someone else(non owner)">Non owner</td>
            <td title="RCA activity created">RCA</td>
            <td title="Tech Lead involved">Tech Lead</td>
            <td title="Technical skill with Genesys software">Skill</td>
            <td title="Keeping you advised of the ticket status">Advised</td>
            <td title="Professionalism">Professional</td><td title="Time to receive resolution">Time</td>
            <td title="Effectiveness of resolution">Effectivness</td><td title="Overall satisfaction">Overall</td></tr>';
        echo '<tr><td title="' . $name . '" rowspan = ' . count($big[$team][$name]) . '>' . $name . ' (' . count($big[$team][$name]) . ')</td>';
        foreach ($big[$team][$name] as $sr => $ss) {
            echo '<td>' . $sr . '</td>';
            echo '<td>' . $big[$team][$name][$sr]['ss'] . '</td>';
            echo '<td title="Tier3" >' . $big[$team][$name][$sr]['tier3'] . '</td>';
            echo '<td title="Solutions">' . $big[$team][$name][$sr]['S'] . '</td>';
            echo '<td title="Docs">' . $big[$team][$name][$sr]['D'] . '</td>';
            echo '<td title="Release Notes">' . $big[$team][$name][$sr]['R'] . '</td>';
            echo '<td title="Not Used">' . $big[$team][$name][$sr]['N'] . '</td>';
            echo '<td title="Linked by non owner">' . $big[$team][$name][$sr]['O'] . '</td>';
            echo '<td title="RCA">' . $big[$team][$name][$sr]['rca'] . '</td>';
            echo '<td title="Tech Lead">' . $big[$team][$name][$sr]['techlead'] . '</td>';
            echo '<td title="">' . $big[$team][$name][$sr]['skill'] . '</td>';
            echo '<td title="">' . $big[$team][$name][$sr]['advised'] . '</td>';
            echo '<td title="">' . $big[$team][$name][$sr]['prof'] . '</td>';
            echo '<td title="">' . $big[$team][$name][$sr]['time'] . '</td>';
            echo '<td title="">' . $big[$team][$name][$sr]['efect'] . '</td>';
            echo '<td title="">' . $big[$team][$name][$sr]['overall'] . '</td>';
            echo '</tr>';
        }
        echo '<tr><td><b>Total:</b></td>';
        echo '<td title="Closed SRs"><b>' . $forperiod[$team][$name]['closed'] . '</b></td><td> </td>';
        echo '<td title="Tier-3 hands off"><b>' . $forperiod[$team][$name]['tier3'] . '(' . $forperiod[$team][$name]['tier3per'] . '%)</b></td>';
        echo '<td title="KCS docs linked"><b>' . $forperiod[$team][$name]['kcs'] . '(' . $forperiod[$team][$name]['kcsper'] . '%)</b></td><td> </td><td title="Top Marks"><b>Top_M:</b></td>';
        echo '<td title="Top Marks"><b>' . $forperiod[$team][$name]['topmarks'] . '%</b></td>';
        echo '<td title="Surveys"><b>Srvs(' . $forperiod[$team][$name]['surveys'] . ')</b></td><td> </td><td> </td>';
        echo '<td title="Skill with Genesys"><b>' . $forperiod[$team][$name]['skill'] . '</b></td>';
        echo '<td title="Advised"><b>' . $forperiod[$team][$name]['advised'] . '</b></td>';
        echo '<td title="Professionalism"><b>' . $forperiod[$team][$name]['prof'] . '</b></td>';
        echo '<td title="Time to resolution"><b>' . $forperiod[$team][$name]['time'] . '</b></td>';
        echo '<td title="Effectivnes"><b>' . $forperiod[$team][$name]['efect'] . '</b></td>';
        echo '<td title="Overall"><b>' . $forperiod[$team][$name]['overall'] . '</b></td>';
        echo '</tr>';

        echo '</table><br><br>';
    }

    if ($_POST['_products'] == 'on')
        require 'buildlowproducts.php';
}
?>
